﻿using System.Collections.Generic;
using AspNetInfo.Core;
using System.Data;

namespace AspNetInfo.Detectors
{
    /// <summary>
    /// Classes implementing this interface are loaded by AspNetInfo as detector plug-ins.
    /// </summary>
    public interface IDetector
    {
        /// <summary>
        /// Friendly name of the detector that will be used in the interface.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Optional description to explain what this detector detects.
        /// </summary>
        string Description { get; }

        /// <summary>
        /// The name of the tab to place the results of this detector on.  
        /// If the tab doesn't already exist a new tab will be created.
        /// </summary>
        string TabName { get; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="permissions">
        /// The detect method should use the EnvironmentPermissions to avoid access secured resources.  
        /// It is helpful to examine the permissions.TrustLevel to determine what can be detected with error.
        /// </param>
        /// <returns>
        /// DataTable with the results of the detection process.  
        /// It is recommended to have have the first column be named "Name".  
        /// see DetectorHelper
        /// </returns>
        DataTable Detect(EnvironmentPermissions permissions);        
    }

    /// <summary>
    /// Standard tab names for the built-in detectors.
    /// </summary>
    public static class Tabs
    {
        public const string General = "General";
        public const string AspNet = "ASP.NET";
        public const string Html = "General";
        public const string Email = "Email";
        public const string WebApp = "Web App.";
    }
}
